package com.aspose.cells;

public class DocumentProperty implements Cloneable {
   private DocumentPropertyCollection a;
   private int b;
   private int c;
   private String d;
   private Object e;
   private boolean f;

   DocumentProperty(DocumentPropertyCollection properties, int group, int id, String name, Object value, boolean isGeneratedName) {
      this.a = properties;
      this.b = group;
      this.c = id;
      this.d = name;
      this.e = value;
      this.f = isGeneratedName;
   }

   public String getName() {
      return this.d;
   }

   public Object getValue() {
      return this.e;
   }

   public void setValue(Object value) {
      if (value == null) {
         throw new IllegalArgumentException("value");
      } else {
         this.e = value;
      }
   }

   public boolean isLinkedToContent() {
      return this.getSource() != null;
   }

   public String getSource() {
      for(int var1 = 0; var1 < this.a.getCount(); ++var1) {
         DocumentProperty var2 = this.a.get(var1);
         if (var2.c() && var2.b() == this.a()) {
            return (String)var2.getValue();
         }
      }

      return null;
   }

   public int getType() {
      if (this.e instanceof String) {
         return 4;
      } else if (this.e instanceof Boolean) {
         return 0;
      } else if (this.e instanceof DateTime) {
         return 1;
      } else if (!(this.e instanceof Integer) && !(this.e instanceof Long)) {
         if (this.e instanceof Double) {
            return 2;
         } else {
            return this.e instanceof byte[] ? 5 : 4;
         }
      } else {
         return 3;
      }
   }

   public boolean isGeneratedName() {
      return this.f;
   }

   int a() {
      return this.c;
   }

   int b() {
      return this.c & -16777217;
   }

   boolean c() {
      return (this.c & 16777216) != 0;
   }

   int d() {
      return this.b;
   }

   public String toString() {
      switch(this.getType()) {
      case 0:
         return (Boolean)this.e ? "Y" : "N";
      case 1:
         return ((DateTime)this.e).k();
      case 2:
         return com.aspose.cells.a.c.zp.b((Double)this.e);
      case 3:
         return com.aspose.cells.b.a.zr.a(this.e);
      case 4:
         return (String)this.e;
      case 5:
         return com.aspose.cells.b.a.zr.a(this.e);
      default:
         return com.aspose.cells.b.a.zr.a(this.e);
      }
   }

   public int toInt() {
      return this.getValue() instanceof Long ? com.aspose.cells.b.a.ze.f(this.getValue()) : (Integer)this.getValue();
   }

   long e() {
      return this.getValue() instanceof Long ? (Long)this.getValue() : (long)(Integer)this.getValue();
   }

   public double toDouble() {
      return (Double)this.getValue();
   }

   public DateTime toDateTime() {
      return (DateTime)this.getValue();
   }

   public boolean toBool() {
      return (Boolean)this.getValue();
   }
}
